//
//  MMGVideoPrizeClawViewModel.h
//  MyApp
//
//  Created by Don on 2017/9/1.
//  Copyright © 2017年 com.memego. All rights reserved.
//

#import "MMGBaseViewModel.h"
//#import "MMGSocketClient.h"
//#import "MMGSocketClient+MessageSender.h"
#import "MMGGameSYSSettings.h"
#import "MMGSocketMsgModel.h"

//typedef void(^MMGGameControlCompletion)(MMGSocketMsgModel *socketMsg,BOOL isFinished);
static const int kMMG_CAMERA_MAXMUM = 2;

typedef enum {
    
    EMMMGVideoPrizeClawViewStateNone = 0,
    EMMMGVideoPrizeClawViewStateOrderGame,
    EMMMGVideoPrizeClawViewStateStartGame,
    EMMMGVideoPrizeClawViewStateJoystick,
    EMMMGVideoPrizeClawViewStateClawAck,
    
}EMMMGVideoPrizeClawViewState;

typedef enum {
    
    EMMMGPrizeClawDeviceStateNone = 0,
    EMMMGPrizeClawDeviceStateConnected,
    
}EMMMGPrizeClawDeviceState;

@interface MMGVideoPrizeClawViewModel : MMGBaseViewModel
//@property(nonatomic, assign)EMMMGVideoPrizeClawViewState vpcvState;
//@property(nonatomic, assign)EMMMGPrizeClawDeviceState deviceConnectState;
@property(nonatomic, assign)int cameraChannel;
@property (nonatomic, assign) int glViewWidth;
@property (nonatomic, assign) int glViewHeight;
@property (nonatomic, assign) int videoWidth;
@property (nonatomic, assign) int videoHeight;

@property (nonatomic, assign) BOOL dismissIAPAlert;
@property (nonatomic, strong) RACSignal *glContextIsReadySignal;

@property (nonatomic, readonly, strong) RACSubject *gameStartSignal;
@property (nonatomic, readonly, strong) RACSubject *onGameMsgDidReceiveSignal;
@property (nonatomic, readonly, strong) RACSubject *onGameStateDidChageSignal;
@property (nonatomic, readonly, strong) RACSubject *onDeviceStateDidChangeSignal;

@property (strong , readonly , nonatomic) RACSubject *timeOut2CloseSignal;

//每局需要金币
@property(nonatomic, assign)int perRoundCostCoin;
//用户当前余额
@property(nonatomic,assign) int userRemaindCoin;
//观看人数
@property(nonatomic,assign) int visiteCount;
//预约人数
@property(nonatomic,assign) int reserveCount;
//当前机器的游戏状态
@property(nonatomic,assign) NSString *gameCurrentStatus;
//当前（游戏等待）游戏剩余时间
@property(nonatomic, assign) int gameTimeOut;

    
//@property(nonatomic, assign)MMGGameControlCompletion gcCompletion;
- (void)onSocketDidRececiveMessage:(MMGSocketMsgModel *)msg;

- (void)startCountDownWithTimeSec:(int)sec counting:(void (^)(int))countingCallback overCount:(void (^)(int))timeOutCallback;
- (void)stopCountDown;

- (void)starSocket;
- (void)closeSocket;

/**
 发送链接娃娃机设备
 
 @param machinId 奖品唯一标识
 */
- (void)sendConnectDeviceWithPrizeId:(NSString *)prizeId;


/**
 用户授权
 
 @param authoCode 授权码
 */
//- (void)sendUserAuthoMsg:(NSString *)authoCode;//user login


/**
 发送游戏预约
 */
- (void)sendGameReserveMsg;


/**
 开始游戏
 
 @param limitTime 游戏限制时间
 */
- (void)sendGameStartMsg:(NSString *)limitTime;


/**
 发送抓控制指令
 
 @param control 控制指令
 */
- (void)sendPrizeClawMachineControlMsgWith:(float)radian;


/**
 发送下爪指令
 */
- (void)sendStartClawMsg;


/**
 发送收到获奖消息回应
 */
- (void)sendWinPrizeMsg;

/*! in app purchase verify */
- (void)sendIAPTransactionReceipt:(NSString *)transReceipt;
@end
